<template>
  <div>
    <h1>测试页面</h1>
    <div>
      <el-button type="primary" @click="testAuthenticated()">测试需要通过认证的请求</el-button>
    </div>
    <div style="margin: 20px auto; border: 1px solid #00f; padding: 20px;">
      {{responseBody}}
    </div>
  </div>
</template>

<script>
import BaseUrl from "@/http/request/BaseUrl";
import TokenAxios from "@/http/request/TokenAxios";

export default {
  data() {
    return {
      responseBody: '请点击以上按钮，以查看响应结果'
    }
  },
  methods: {
    testAuthenticated() {
      let url = BaseUrl.PASSPORT + '/test/authenticated';
      console.log('url = ' + url);

      TokenAxios.get(url).then((response) => {
        this.responseBody = response.data;
      });
    }
  },
}
</script>